using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace VOL.Entity.DomainModels
{
    /// <summary>
    /// 货品详细信息查询结果DTO
    /// </summary>
    public class ProductWithDetailsDto
    {
        /// <summary>
        /// 货品ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 货品编号
        /// </summary>
        public string GoodsCode { get; set; }

        /// <summary>
        /// 货品名称
        /// </summary>
        public string GoodsName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string SpecModel { get; set; }

        /// <summary>
        /// 货品类型ID
        /// </summary>
        public int ProductTypeId { get; set; }

        /// <summary>
        /// 货品类型名称
        /// </summary>
        public string ProductTypeName { get; set; }

        /// <summary>
        /// 供应商ID
        /// </summary>
        public long SupplierId { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 客户ID
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 入库参考价/元
        /// </summary>
        public decimal PurchasePrice { get; set; }

        /// <summary>
        /// 出库参考价/元
        /// </summary>
        public decimal SalePrice { get; set; }

        /// <summary>
        /// 当前库存
        /// </summary>
        public int CurrentInventory { get; set; }

        /// <summary>
        /// 库存总金额
        /// </summary>
        public decimal TotalInventoryAmount { get; set; }

        /// <summary>
        /// 保质期管理
        /// </summary>
        public sbyte ShelfLifeManagement { get; set; }

        /// <summary>
        /// 保质期时长（数值）
        /// </summary>
        public int ShelfLife { get; set; }

        /// <summary>
        /// 保质期单位（天/月/年）
        /// </summary>
        public string ShelfLifeUnit { get; set; }

        /// <summary>
        /// 预警天数(天)
        /// </summary>
        public int WarningDays { get; set; }

        /// <summary>
        /// 显示顺序
        /// </summary>
        public int? DisplayOrder { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public sbyte Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Notes { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string Modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? ModifyDate { get; set; }
    }

    /// <summary>
    /// 货品分页查询请求参数
    /// </summary>
    public class ProductQueryRequest
    {
        /// <summary>
        /// 页码，默认1
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页记录数，默认20
        /// </summary>
        public int PageSize { get; set; } = 20;

        /// <summary>
        /// 货品名称或编号（模糊搜索）
        /// </summary>
        public string Keyword { get; set; }

        /// <summary>
        /// 货品类型ID（精确匹配）
        /// </summary>
        public int? ProductTypeId { get; set; }

        /// <summary>
        /// 供应商ID（精确匹配）
        /// </summary>
        public long? SupplierId { get; set; }

        /// <summary>
        /// 客户ID（精确匹配）
        /// </summary>
        public int? UserId { get; set; }

        /// <summary>
        /// 状态（精确匹配）
        /// </summary>
        public sbyte? Status { get; set; }

        /// <summary>
        /// 排序字段（默认按创建时间倒序）
        /// </summary>
        public string OrderBy { get; set; } = "CreateDate";

        /// <summary>
        /// 排序方向（asc/desc，默认desc）
        /// </summary>
        public string OrderDirection { get; set; } = "desc";
    }

    /// <summary>
    /// 货品分页查询结果
    /// </summary>
    public class ProductQueryResult
    {
        /// <summary>
        /// 查询是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 货品列表
        /// </summary>
        public List<ProductWithDetailsDto> Data { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页记录数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 是否有上一页
        /// </summary>
        public bool HasPreviousPage { get; set; }

        /// <summary>
        /// 是否有下一页
        /// </summary>
        public bool HasNextPage { get; set; }
    }
}
